home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.image.ImageObserver;
-
- public class MarqueeBorderPanel2 extends DynamicBorderPanel2 {
- int lightCountX;
- int lightCountY;
- int[] xPos;
- int[] yPos;
- final int lightCount = 4;
- Image osImage;
- Graphics osg;
- Color lightColor;
- Color offColor;
- Image onLightImage;
- Image offLightImage;
-
- void GetParameters(Applet var1, int var2) {
- String var3 = var1.getParameter("marqueeBorderThickness" + var2);
- ((BorderPanel2)this).SetThickness(AppletParam2.GetInt(var3, 5));
- var3 = var1.getParameter("marqueeBorderBkColor" + var2);
- ((BorderPanel2)this).SetBackgroundColor(AppletParam2.GetColor(var3, (Color)null));
- var3 = var1.getParameter("marqueeBorderBkImage" + var2);
- ((BorderPanel2)this).SetBackgroundImage(AppletParam2.GetImage(var1, var3));
- var3 = var1.getParameter("marqueeBorderLightColor" + var2);
- this.SetLightColor(AppletParam2.GetColor(var3, Color.yellow));
- var3 = var1.getParameter("marqueeBorderOffColor" + var2);
- this.SetOffColor(AppletParam2.GetColor(var3, Color.black));
- var3 = var1.getParameter("marqueeBorderOnLightImage" + var2);
- this.SetOnLightImage(AppletParam2.GetImage(var1, var3));
- var3 = var1.getParameter("marqueeBorderOffLightImage" + var2);
- this.SetOffLightImage(AppletParam2.GetImage(var1, var3));
- }
-
- public MarqueeBorderPanel2(Applet var1, int var2) {
- this.lightColor = Color.yellow;
- this.offColor = Color.white;
- this.GetParameters(var1, var2);
- this.xPos = new int[4];
- this.yPos = new int[4];
- }
-
- public void SetLightColor(Color var1) {
- this.lightColor = new Color(var1.getRGB());
- }
-
- public void SetOffColor(Color var1) {
- this.offColor = new Color(var1.getRGB());
- }
-
- public void SetOnLightImage(Image var1) {
- this.onLightImage = var1;
- }
-
- public void SetOffLightImage(Image var1) {
- this.offLightImage = var1;
- }
-
- public void DoPaint(Graphics var1) {
- if (this.osImage == null) {
- this.lightCountX = ((Component)this).size().width / super.thickness;
- this.lightCountY = ((Component)this).size().height / super.thickness;
- this.xPos[0] = 0;
- this.yPos[0] = 0;
- this.xPos[1] = this.lightCountX - 1;
- this.yPos[1] = 0;
- this.xPos[2] = 0;
- this.yPos[2] = this.lightCountY - 1;
- this.xPos[3] = this.lightCountX - 1;
- this.yPos[3] = this.lightCountY - 1;
- this.osImage = ((Component)this).createImage(((Component)this).size().width, ((Component)this).size().height);
- this.osg = this.osImage.getGraphics();
- }
-
- if (this.offColor != null) {
- this.osg.setColor(this.offColor);
- } else {
- this.osg.setColor(Color.lightGray);
- }
-
- for(int var2 = 0; var2 < this.lightCountX; ++var2) {
- if (this.offLightImage == null) {
- this.osg.fillOval(var2 * super.thickness, 0, super.thickness - 1, super.thickness - 1);
- this.osg.fillOval(var2 * super.thickness, ((Component)this).size().height - super.thickness, super.thickness - 1, super.thickness - 1);
- } else {
- this.osg.drawImage(this.offLightImage, var2 * super.thickness, 0, (ImageObserver)null);
- this.osg.drawImage(this.offLightImage, var2 * super.thickness, ((Component)this).size().height - super.thickness, (ImageObserver)null);
- }
- }
-
- for(int var3 = 0; var3 < this.lightCountY; ++var3) {
- if (this.offLightImage == null) {
- this.osg.fillOval(0, var3 * super.thickness, super.thickness - 1, super.thickness - 1);
- this.osg.fillOval(((Component)this).size().width - super.thickness, var3 * super.thickness, super.thickness - 1, super.thickness - 1);
- } else {
- this.osg.drawImage(this.offLightImage, 0, var3 * super.thickness, (ImageObserver)null);
- this.osg.drawImage(this.offLightImage, ((Component)this).size().width - super.thickness, var3 * super.thickness, (ImageObserver)null);
- }
- }
-
- if (this.lightColor != null) {
- this.osg.setColor(this.lightColor);
- } else {
- this.osg.setColor(Color.yellow);
- }
-
- for(int var4 = 0; var4 < 4; ++var4) {
- if (this.yPos[var4] == 0) {
- if (this.onLightImage == null) {
- this.osg.fillOval(this.xPos[var4] * super.thickness, 0, super.thickness - 1, super.thickness - 1);
- } else {
- this.osg.drawImage(this.onLightImage, this.xPos[var4] * super.thickness, 0, (ImageObserver)null);
- }
- }
-
- if (this.xPos[var4] == 0) {
- if (this.onLightImage == null) {
- this.osg.fillOval(0, this.yPos[var4] * super.thickness, super.thickness - 1, super.thickness - 1);
- } else {
- this.osg.drawImage(this.onLightImage, 0, this.yPos[var4] * super.thickness, (ImageObserver)null);
- }
- }
-
- if (this.yPos[var4] == this.lightCountY - 1) {
- if (this.onLightImage == null) {
- this.osg.fillOval(this.xPos[var4] * super.thickness, ((Component)this).size().height - super.thickness, super.thickness - 1, super.thickness - 1);
- } else {
- this.osg.drawImage(this.onLightImage, this.xPos[var4] * super.thickness, ((Component)this).size().height - super.thickness, (ImageObserver)null);
- }
- }
-
- if (this.xPos[var4] == this.lightCountX - 1) {
- if (this.onLightImage == null) {
- this.osg.fillOval(((Component)this).size().width - super.thickness, this.yPos[var4] * super.thickness, super.thickness - 1, super.thickness - 1);
- } else {
- this.osg.drawImage(this.onLightImage, ((Component)this).size().width - super.thickness, this.yPos[var4] * super.thickness, (ImageObserver)null);
- }
- }
- }
-
- for(int var5 = 0; var5 < 4; ++var5) {
- if (this.xPos[var5] == 0 && this.yPos[var5] == 0) {
- int var12 = this.xPos[var5]++;
- } else if (this.xPos[var5] == this.lightCountX - 1 && this.yPos[var5] == 0) {
- int var11 = this.yPos[var5]++;
- } else if (this.xPos[var5] == this.lightCountX - 1 && this.yPos[var5] == this.lightCountY - 1) {
- int var10 = this.xPos[var5]--;
- } else if (this.xPos[var5] == 0 && this.yPos[var5] == this.lightCountY - 1) {
- int var9 = this.yPos[var5]--;
- } else if (this.xPos[var5] > 0 && this.xPos[var5] < this.lightCountX - 1 && this.yPos[var5] == 0) {
- int var8 = this.xPos[var5]++;
- } else if (this.xPos[var5] > 0 && this.xPos[var5] < this.lightCountX - 1 && this.yPos[var5] == this.lightCountY - 1) {
- int var7 = this.xPos[var5]--;
- } else if (this.xPos[var5] == 0 && this.yPos[var5] > 0 && this.yPos[var5] < this.lightCountY - 1) {
- int var6 = this.yPos[var5]--;
- } else if (this.xPos[var5] == this.lightCountX - 1 && this.yPos[var5] > 0 && this.yPos[var5] < this.lightCountY - 1) {
- int var10002 = this.yPos[var5]++;
- }
- }
-
- var1.drawImage(this.osImage, 0, 0, (ImageObserver)null);
- }
-
- void DoResize(int var1, int var2) {
- this.osImage = null;
- this.osg = null;
- }
- }
-